<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>二合一App JS-SDK测试</title>
  <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
  <style>
    body,
    html {
      height: 100%;
      -webkit-tap-highlight-color: transparent;
    }

    body {
      font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif;
    }

    ul {
      list-style: none;
    }

    .page,
    body {
      background-color: #ededed;
    }
  </style>
  <link href="https://cdn.bootcss.com/weui/2.1.3/style/weui.min.css" rel="stylesheet">
  <script type="text/javascript">
    var userAgent = navigator.userAgent;
    if (userAgent.indexOf('(Royal Flush; Qs)') > -1) {
      __POWERED_BY_OEMAPP__=true;
      document.write('<script type="text/javascript" src="https://h5itest1.dfzq.com.cn/open/oem-jsbridge-1.1.0.js"><\/script>');
    }
    else if (/DFYJ/i.test(userAgent)) {
      document.write('<script type="text/javascript" src="https://h5itest1.dfzq.com.cn/open/dfzq-jsbridge-2.0.0.js"><\/script>');
    }
  </script>
</head>
<body ontouchstart="">
  <div class="container" id="container">
    <div class="page input js_show">
      <div class="page__bd">
        <div class="weui-cells__title">发起 注册 事件 测试</div>
        <div class="weui-cells weui-cells_form">
          <div class="weui-btn-area">
            <div style="text-align: center;">建立授信</div>
            <a id="btn-oauth" class="weui-btn weui-btn_primary" href="javascript:"> 发起事件 oauth </a>
          </div>
          <div class="weui-btn-area">
            <div style="text-align: center;">登录</div>
            <a id="btn-login" class="weui-btn weui-btn_primary" href="javascript:"> 发起事件 onLogin </a>
          </div>
          <div class="weui-btn-area">
            <div style="text-align: center;">加解密通讯</div>
            <a id="btn-request" class="weui-btn weui-btn_primary" href="javascript:"> 发起请求 </a>
          </div>
        </div>
      </div>
    </div>
    <div class="weui-footer">
      <p class="weui-footer__text">Copyright © 2019-2025 orientsec.ued</p>
    </div>
  </div>
  <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
  <script>
    var vConsole = new VConsole();
  </script>
  <script>
    fastman.ready(function () {
      /**
      * 发起事件 触发 btn-oauth
      */
      $("#btn-oauth").on("click", function (options) {
        fastman.oauth({
          success: function (res) {
            console.log("res: " + JSON.stringify(res));
            alert(JSON.stringify(res));
          },
          fail: function (err) {
            console.log("err: " + JSON.stringify(err));
            alert(JSON.stringify(err));
          }
        });
      });

      /**
      * 发起事件 触发 btn-login
      */
      $("#btn-login").on("click", function (options) {
        fastman.onLogin({
          success: function (res) {
            console.log("res: " + JSON.stringify(res));
            alert(JSON.stringify(res));
          },
          fail: function (err) {
            console.log("err: " + JSON.stringify(err));
            alert(JSON.stringify(err));
          }
        });
      });
    });
  </script>

</body>

</html>